﻿namespace System.IO
{
    /// <summary>
    /// BinaryWriter扩展类
    /// </summary>
    public static class BinaryWriterEx
    {
        /// <summary>
        /// 写数据
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="data"></param>
        public static void Write(this BinaryWriter writer, Span<byte> data)
        {
            for (int i = 0; i < data.Length; i++)
            {
                writer.Write(data[i]);
            }
        }
    }
}
